function b = subsref(s,index)
% SUBSREF Define field name indexing for  objects
switch index.type
    case '()'
        error('Unsupported');
    case '.'
        switch index.subs
			case 'h'
				b = s.h;
			case 'x'
				b = s.x;
			case 'y'
				b = s.y;
			case 'site_width'
				b = s.site_width;
			case 'site_width_unit'
				b = s.site_width_unit;
			case 'layer_thickness'
				b = s.layer_thickness;
			case 'layer_thickness_unit'
				b = s.layer_thickness_unit;
			case 'r2'
				b = calc_r2(s);
			case 'm2'
                b = calc_m2(s);
			otherwise
				error([propName,' is not a valid property']);
        end
end